@import './variables.scss';
@import './channel.scss';

// 快速样式与辅助类
//文字颜色类
@each $colorKey, $colorVal in $colors {
  .t-#{$colorKey} {
    color: #{$colorVal} !important;
  }
}

//文字字号类
@each $sizeKey, $size in $font-sizes {
  .fs-#{$sizeKey} {
    font-size: #{$size}rem;
  }
}

// 行高为1
.lh-1 {
  line-height: 1;
}

// 加粗字体
.fw-bold {
  font-weight: bolder;
}

//文本对齐类
@each $var in ('center', 'left', 'right', 'justify') {
  .t-#{$var} {
    text-align: #{$var} !important;
  }
}

// 文本溢出
.t-ellipsis {
  //1行
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

// 盒子相关
.fulled-w {
  width: 100%;
}

.fulled-h {
  height: 100%;
}

// 布局相关
.hide {
  display: none !important;
}

// margin居中
.m-center {
  margin: 0 auto;
}

// 浮动
.fl {
  float: left;
}

.fr {
  float: right;
}

/* 清除浮动 */
.clearfix::after {
  clear: both;
  display: block;
  visibility: hidden;
  height: 0;
  content: '.';
}

.clearfix {
  *zoom: 1;

  /* IE/7/6 */
}

// flex布局
.flex-shrink-0 {
  flex-shrink: 0;
}

.d-flex {
  display: flex !important;
}

.d-inline-flex {
  display: inline-flex;
}

.flex-column {
  flex-direction: column;
}

.flex-row-reverse {
  flex-direction: row-reverse;
}

.flex-column-reverse {
  flex-direction: column-reverse;
}

.flex-wrap {
  flex-wrap: wrap;
}

@each $flexKey, $flexVal in $flex-jc {
  .jc-#{$flexKey} {
    justify-content: $flexVal;
  }
}

@each $flexKey, $flexVal in $flex-al {
  .al-#{$flexKey} {
    align-items: $flexVal;
  }
}

@each $flexKey, $flexVal in $flex-al {
  .as-#{$flexKey} {
    align-self: $flexVal;
  }
}

@each $flexKey, $flexVal in $flex-jc {
  .ac-#{$flexKey} {
    align-content: $flexVal;
  }
}

.flex-1 {
  flex: 1;
}

// 内外边距
@each $typeKey, $typeVal in $space-types {
  // .m-12, p-12...
  @each $sizeKey, $sizeVal in $space-sizes {
    .#{$typeKey}-#{$sizeKey} {
      #{$typeVal}: #{$sizeVal}rem !important;
    }
  }

  // .mx-12 px-12...
  @each $sizeKey, $sizeVal in $space-sizes {
    .#{$typeKey}x-#{$sizeKey} {
      #{$typeVal}-left: #{$sizeVal}rem !important;
      #{$typeVal}-right: #{$sizeVal}rem !important;
    }
  }

  // .my-12，py-12...
  @each $sizeKey, $sizeVal in $space-sizes {
    .#{$typeKey}y-#{$sizeKey} {
      #{$typeVal}-top: #{$sizeVal}rem !important;
      #{$typeVal}-bottom: #{$sizeVal}rem !important;
    }
  }

  // .mt-12, .mr-12...
  @each $directKey, $directVal in $space-directions {
    @each $sizeKey, $sizeVal in $space-sizes {
      .#{$typeKey}#{$directKey}-#{$sizeKey} {
        #{$typeVal}-#{$directVal}: #{$sizeVal}rem !important;
      }
    }
  }
}

// 定位类
@each $positionKey, $positionVal in $space-position {
  .p-#{$positionKey} {
    position: #{$positionVal} !important;
  }
}

// 绝对居中
.absCenter {
  position: absolute !important;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.absCenterX {
  position: absolute !important;
  left: 50%;
  transform: translateX(-50%);
}

.absCenterY {
  position: absolute !important;
  top: 50%;
  transform: translateY(-50%);
}

//背景颜色类
@each $colorKey, $colorVal in $bgColors {
  .bgc-#{$colorKey} {
    background-color: #{$colorVal} !important;
  }
}

.bg-linear {
  background-image: $linearColor;
}

// border-radius
.bd-filt {
  border-radius: 2px;
}

// a链接块标签
.a-block {
  display: block;
}

.pointer {
  cursor: pointer;
}

.cursor-copy {
  cursor: copy;
}

.cursor-not-allowed {
  cursor: not-allowed;
}

// sprite图标类
.sprite {
  display: inline-block;
  background-repeat: no-repeat;
  background-size: 23px 28px;
}

// icon图标类
.icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;

  &.icon-more {
    background-image: url('~@/assets/images/icons/icon-more.png');
  }

  &.icon-arrow-dark {
    background-image: url('~@/assets/images/icons/icon-arrow-dark.png');
    transition: all 0.3s;

    &.dropdown-in {
      transform: rotate(180deg);
    }
  }

  &.icon-question {
    vertical-align: middle;
    @include bg('icons/icon-question-1.png');
  }
}

// btn类
.btn {
  &.btn-lock {
    @include bg('icons/icon-unlock.png');
    width: 32px;
    height: 32px;

    &.locking {
      @include bg('icons/icon-lock.png');
    }
  }
}

html {
  overflow-y: hidden;
  height: 100%;
  font-size: 100px;
}

body {
  height: 100%;
  font: 14px / 1 Source Han Sans CN, Source Han Sans CNArial, 'Microsoft YaHei', '\5b8b\4f53', sans-serif;
  color: map-get($colors, dark);
  -webkit-font-smoothing: antialiased; //平滑字体
}

@font-face {
  font-family: 'D-DIN-DIN';
  src: url(../fonts/D-DIN.ttf);
}

@font-face {
  font-family: 'D-DIN-DIN-Bold';
  src: url(../fonts/D-DIN-Bold.ttf);
}

// 去除use-select
.remove-use-select {
  user-select: none;
}

// 鼠标变小手
.cursor-pointer {
  cursor: pointer;
}
